<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
<link href="/css/animate.css" rel="stylesheet">
<link href="/css/layui.css" rel="stylesheet">
<link href="/css/style.css?v=4.1.0" rel="stylesheet">
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">图片路径：</label>
                            <div class="col-sm-8">
                                <div class="col-sm-8">
                                    <img id="imgLogo" src="" style="width:100px;display:block;">
                                    <a style="display:none;" class="btn default" id="removeimg"
                                       href="javascript:removeImg()">移除</a>
                                    <input type="hidden" id="imageUrl" name="imageUrl">
                                    <button type="button" class="btn btn-success" id="btnUpload">
                                        <i class="fa fa-cloud"></i>上传文件
                                    </button>
                                </div>
                        <!--    <div class="col-sm-8">
                                <input id="imageUrl" name="imageUrl" class="form-control" type="text">
                            </div>-->
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">类型编码：</label>
                            <div class="col-sm-8">
                                <select  class="form-control select2" id="typecode" name="typecode">
                                    <option value="0"> -- 请选择 -- </option>
                                    <option  th:each="c:${columnList}"   th:value="${c.id}" th:text="${c.name}" ></option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">跳转url：</label>
                            <div class="col-sm-8">
                                <input id="tourl" name="tourl" value="#" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">显示title名称：</label>
                            <div class="col-sm-8">
                                <input id="title" name="title" class="form-control" type="text">
                            </div>
                        </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">排序数字</label>
                                <div class="col-sm-8">
                                    <input id="sort" name="sort"  class="form-control" type="text">
                                </div>
                            </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/appjs/webshow/banner/add.js">
</script>
<script src="/js/content.js?v=1.0.0"></script>
<script src="/js/layui.js"></script>
<script src="/js/plugins/clipboard/clipboard.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>
<script type="text/javascript">

    layui.use('upload', function () {
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#btnUpload', //绑定元素
            url: '/common/sysFile/imgupload', //上传接口
            size: 1000,
            accept: 'file',
            done: function (r) {
                $("#imgLogo").attr("src",r.data)
                $("#imageUrl").val(r.data);
               // $("#removeimg").show();
            },
            error: function (r) {
                layer.msg(r.msg);
            }
        });
    });

    function removeImg() {
        $("#imgLogo").attr("src", "")
        $("#logo").val("");
        $("#removeimg").hide();
    }
</script>
</body>
</html>
